<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Debt Graph</title>
    <link rel="icon" type="image/png" href="{{ url_for('static', filename='phillfinance.png') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
    <script src="https://cdn.jsdelivr.net/npm/plotly.js-dist-min@2.10.0/plotly.min.js"></script>
</head>
<body>
    <nav>
        <ul>
            <li><a href="{{ url_for('home') }}">Home</a></li>
            {% if current_user.is_authenticated %}
                <li><a href="{{ url_for('dashboard') }}">Dashboard</a></li>
                <li><a href="{{ url_for('logout') }}">Logout</a></li>
            {% else %}
                <li><a href="{{ url_for('login') }}">Login</a></li>
                <li><a href="{{ url_for('register') }}">Register</a></li>
            {% endif %}
        </ul>
    </nav>

    <div class="container">
        <h1>Debt Distribution</h1>

        <!-- Render the Debt Bar Graph -->
        <div id="debt-chart">{{ debt_fig_html | safe }}</div>
        <p><a href="{{ url_for('export_debts') }}" class="button">Export Debts to CSV</a></p>



        <p><a href="{{ url_for('dashboard') }}" class="button">Back to Dashboard</a></p>
    </div>
</body>
</html>
